package epinions;

import java.io.IOException;

import org.apache.poi.openxml4j.exceptions.InvalidFormatException;

import polarizedMF.Step8c_Ordinal_MeasurePercentage;
import writeToExcel.WritePercentageToExcel;
import constants.Constants;
import data.MatrixSize;
import data.Param;

public class Step8c_Ordinal_MeasurePercentage_epinions {

	public static void main(String[] args) throws IOException, InvalidFormatException {

		double[][] posPercent = new double[6][5];
		double[][] neuPercent = new double[6][5];
		double[][] negPercent = new double[6][5];

		MatrixSize size = new MatrixSize(22166, 296277);
		Param param = new Param((byte) 5, 0.02, 0.4);
		String svm_dataset = Constants.svm_dir+"epinions\\";
		String dataset = Constants.dir+"epinions\\epinions\\";
		String fold = "5";

		String[] epsilons = { "0", "05", "1", "15", "2", "25" };
		double margin = 0;

		for (int i = 0; i < 6; i++) {
			String epsilon = epsilons[i];
			for (int j = 0; j < 5; j++) {
				Step8c_Ordinal_MeasurePercentage step8c = new Step8c_Ordinal_MeasurePercentage(
						svm_dataset, dataset, fold, epsilon, margin + j * 0.5,
						size, param);

				posPercent[i][j] = step8c.getPosPercent();
				neuPercent[i][j] = step8c.getNeuPercent();
				negPercent[i][j] = step8c.getNegPercent();

				System.out
						.println("------------------------------------------------------------------------------------");
			}
		}

		String datasetName = "epinions";

		WritePercentageToExcel writePTE = new WritePercentageToExcel(
				datasetName, fold, posPercent, neuPercent, negPercent);
	}

}
